<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method='html' encoding='UTF-8' doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" indent='yes'/>
	
	<!-- template to dinamically create feed items -->
	<!-- RSS template -->
	<!-- 1.0 -->
	<xsl:template name="Rss_1_ItemLoader">
		<xsl:param name="src"/>
		<xsl:for-each select="$src/RDF">
			<xsl:for-each select="item">
				<li class="non_visiting">
					<h3><a><xsl:attribute name="href"><xsl:value-of select="concat('#',title)"/></xsl:attribute>
					<xsl:value-of select="title"/></a></h3>
					<p>no publish date given</p>
				</li>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>	
	<!-- 2.0 -->
	<xsl:template name="Rss_2_ItemLoader">
		<xsl:param name="src"/>
		<xsl:for-each select="$src/rss/channel">
			<xsl:for-each select="item">
				<li class="non_visiting">
					<h3><a><xsl:attribute name="href"><xsl:value-of select="concat('#',title)"/></xsl:attribute>
					<xsl:value-of select="title"/></a></h3>
					<p><xsl:value-of select="pubDate"/></p>
				</li>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>

	<!-- ATOM template -->
	<xsl:template name="AtomItemLoader">
		<xsl:param name="src"/>
		<xsl:for-each select="$src/feed">
			<xsl:for-each select="entry">
				<li class="non_visiting">
					<h3><a><xsl:attribute name="href"><xsl:value-of select="concat('#',title)"/></xsl:attribute>
					<xsl:value-of select="title"/></a></h3>
					<p><xsl:value-of select="updated"/></p>
				</li>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>
	
	
	<!-- template to dinamically create feed content -->
	<!-- RSS template -->
	<!-- 1.0 -->
	<xsl:template name="Rss_1_ContentLoader">
		<xsl:param name="src"/>
		<xsl:for-each select="$src/RDF">
			<!-- rss title -->
			<h4 id="t_t"><xsl:value-of select="title"/></h4>
			<!-- items -->
			<xsl:for-each select="item">
				<!-- item title -->
				<h2 id="p_t"><a><xsl:attribute name="name"><xsl:value-of select="title"/></xsl:attribute>
				<xsl:value-of select="title"/></a></h2>
				<h6 id="dat">no publish date given - 
					<a target="_blank"><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>link to original post</a>
				</h6>
				<!-- share box -->
				<xsl:call-template name="sharebox">
					<xsl:with-param name="link" select="link"/>
				</xsl:call-template>
				<!-- description -->
				<div id="inner"><xsl:value-of disable-output-escaping="yes" select="description"/></div>
				<!-- jump to top -->
				<p class="top_link"><a href="#top">Top</a></p>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>
	<!-- 2.0 -->
	<xsl:template name="Rss_2_ContentLoader">
		<xsl:param name="src"/>
		<xsl:for-each select="$src/rss/channel">
			<!-- rss title -->
			<h4 id="t_t"><xsl:value-of select="title"/></h4>
			<!-- items -->
			<xsl:for-each select="item">
				<!-- item title -->
				<h2 id="p_t"><a><xsl:attribute name="name"><xsl:value-of select="title"/></xsl:attribute>
				<xsl:value-of select="title"/></a></h2>
				<h6 id="dat"><xsl:value-of select="pubDate"/>
					- <a target="_blank"><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>link to original post</a>
				</h6>
				<!-- share box -->
				<xsl:call-template name="sharebox">
					<xsl:with-param name="link" select="link"/>
				</xsl:call-template>
				<!-- description -->
				<div id="inner"><xsl:value-of disable-output-escaping="yes" select="description"/></div>
				<!-- jump to top -->
				<p class="top_link"><a href="#top">Top</a></p>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>	
	
	<!-- ATOM template -->
	<xsl:template name="AtomContentLoader">
		<xsl:param name="src"/>
		<xsl:for-each select="$src/feed">
			<!-- rss title -->
			<h4 id="t_t"><xsl:value-of select="title"/></h4>
			<!-- items -->
			<xsl:for-each select="entry">
				<!-- item title -->
				<h2 id="p_t"><a><xsl:attribute name="name"><xsl:value-of select="title"/></xsl:attribute>
				<xsl:value-of select="title"/></a></h2>
				<h6 id="dat"><xsl:value-of select="updated"/>
					- <a target="_blank"><xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>link to original post</a>
				</h6>
				<!-- share box -->
				<xsl:call-template name="sharebox">
					<xsl:with-param name="src" select="link"/>
				</xsl:call-template>
				<!-- description -->
				<div id="inner"><xsl:value-of disable-output-escaping="yes" select="summary"/>
				<!-- fix for dumb feed writer -->
				<xsl:if test="content"><xsl:value-of disable-output-escaping="yes" select="content"/></xsl:if>
				</div>
				<!-- jump to top -->
				<p class="top_link"><a href="#top">Top</a></p>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>	

	<!-- share box template -->
	<xsl:template name="sharebox">
		<xsl:param name="link"/>
		<div id="share_box">
			<ul>
				<li><a title="Share on Facebook!">
					<xsl:attribute name="href"><xsl:value-of select="concat('http://www.facebook.com/share.php?u=',$link)"/></xsl:attribute>
					<img alt="Share on Facebook!" src="../images/icons/facebook_share.gif"/></a>
				</li>
				<li><a title="Furl it!">
					<xsl:attribute name="href"><xsl:value-of select="concat('http://www.furl.net/storeIt.jsp?u=',$link)"/></xsl:attribute>
					<img alt="Furl it!" src="../images/icons/furl_share.gif"/></a>
				</li>
				<li><a title="Fav on Technocrati!">
					<xsl:attribute name="href"><xsl:value-of select="concat('http://technorati.com/faves/?add=',$link)"/></xsl:attribute>
					<img alt="Fav on Technocrati!" src="../images/icons/technocrati_share.gif"/></a>
				</li>
				<li><a title="Add on del.icio.us!">
					<xsl:attribute name="href"><xsl:value-of select="concat('http://del.icio.us/post?url=',$link)"/></xsl:attribute>
					<img alt="Add on del.icio.us!" src="../images/icons/delicious_share.gif"/></a>
				</li>
				<li><a title="Digg this post!">
					<xsl:attribute name="href"><xsl:value-of select="concat('http://digg.com/submit?phase=2&amp;url=',$link)"/></xsl:attribute>			
					<img alt="Digg this post!" src="../images/icons/digg_share.gif"/></a>
				</li>
			</ul>
		</div>
	</xsl:template>
	

</xsl:stylesheet>	
